import React from 'react';
import { WeaNewScroll } from 'ecCom';

class SearchRcmd extends React.Component {
    render() {
        const { data = [] } = this.props;

        return (
            <div className="portal-em-menu-search-rcmd-content">
                <div className="portal-em-menu-search-rcmd-result">
                    <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@79n5lt`} height="100%">
                        <div className="portal-em-menu-search-rcmd-list">
                            <ul>
                                {
                                    data.map((item, index) => (
                                            <li key={index} title={item.name} onClick={() => this.props.onOpen(item, 'search')}>
                                                <div className={`portal-em-menu-search-rcmd-icon icon-menu-module icon-menu-module-${item.moduleId}`}><i /></div>
                                                <span className="portal-em-menu-search-rcmd-name">{item.name}</span>
                                            </li>
                                        ))
                                }
                            </ul>
                        </div>
                    </WeaNewScroll>
                </div>
            </div>
        );
    }
}

export default SearchRcmd;
